<template>
  <div class="container">
      <h3 class="tit">{{list.title}}</h3>
      <div class="subtit">
        <span class="time">{{list.add_time |dateFormat}}</span>
        <span class="click">{{list.click}}</span>
      </div>
      <hr>

      <div class="text" v-html="list.content">
      </div>

      <comment :newID="this.id"></comment>
  </div>
</template>
<script>

import {api} from '@/common/api.js'
import comment from '@/components/subComps/comment'

export default {
  data () {
    return {
      id: this.$route.params.id,
      list: []
    }
  },

  created () {
    this.getLunBo()
  },
  methods: {
    getLunBo () {
      this.$axios.get(`${api}getnew/${this.id}`).then(res => {
        this.list = res.data.message[0] ? res.data.message[0] : ''
      }).catch(err => {
        console.log(err)
      })
    }
  },
  components: {
    comment
  }
}
</script>
<style lang="scss">
  .container{
    padding: 4px;
    .tit{

    }
    .subtit{
      display: flex;
      justify-content: space-between;
      .time,.click{
        font-size: .02rem;
        color: #888;
      }
    }
    .text{
        font-size: .019rem;
        text-align: left
    }
  }
</style>
